package com.treasure.mall.biz.entity.live;

import com.treasure.mall.biz.entity.BasePO;
import com.treasure.mall.biz.entity.user.UserPO;
import lombok.Data;

import javax.persistence.*;

/**
 *
 * 直播消息
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.entity.live
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/6/23 13:35
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.entity.live Inc. All rights reserved.
 */
@Entity
@Data
@Table(name = "zb_live_history_message")
public class LiveHistoryMessagePO extends BasePO {

    @ManyToOne
    @JoinColumn(name = "rel_user_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    protected UserPO userPO;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;
    /**
     * 直播session
     */
    @OneToOne
    @JoinColumn(name = "rel_live_session_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private LiveSessionPO liveSessionPO;

    /**
     * 消息内容
     */
    @Column(name = "message_body", columnDefinition = "longtext")
    private String messageBody;

    /**
     * 消息的作者
     */
    @Column(name = "message_author", length = 30)
    private String messageAuthor;
}
